import http from '@/axios';

export const loadFile = (path:string) => {
  return http({
    url: path,
    method: "get",
  })
}

export const downloadFile = (uri:string,attr:Record<string,any> = {}) => {
  return http({
    url:uri,
    method:"get",
    responseType: "blob",
    ...attr
  })
}


export const uploadFile = (uri:string,data:Record<string,any>,attr:Record<string,any> = {}) => {
  return http({
    url:uri,
    method:"post",
    headers: { "Content-Type": "multipart/form-data" },
    data,
    ...attr
  })
}